libxl: stat the path for all non-qdisk backends (including unknown)
authorIan Campbell <ian.campbell@citrix.com>
Fri, 26 Apr 2013 11:41:43 +0000 (12:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 26 Apr 2013 14:59:41 +0000 (15:59 +0100)
commit3ed6d71247b6ef3c701654824f5b4c961eacfd61
tree645107badde356651e222918eecd11d2f268dc99
parentb26d570c93a162c2b8f7a9ea336b1935b01af0b2
libxl: stat the path for all non-qdisk backends (including unknown)

The commit a8a1f236a296 "libxl: Only call stat() when adding a disk if we
expect a device to exist." changed things to only stat the file when the phy
backend was explicitly requested. This broke the case where we are probing and
would normally be able to decide on the phy option.

Since the intention of that commit was to allow for backends with no explicit
file in dom0 (i.e. network remote backend such as ceph) the lowest impact fix
appears to be to make that explicit. It turns out that tap disk can also
potentially handle such paths.

The only backend which requires a local file/device is PHY but we need to
handle UNKNOWN too in order for subsequent probing to work. Note that it is
not possible to autoprobe the backend if the path is not a local object, so we
don't need to worry about autoprobing ceph etc.

This should probably be revisited to rationalize the probing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
tools/libxl/libxl_device.c